package com.itheima.泛型;

public class MyGencricityClass {
    public static void main(String[] args) {
        Box<String> s = new Box<>();
        s.setElement("这是泛型的第一个字符串");
        String StrE = s.getElement();
        System.out.println(StrE);

        Box<Double> d=new Box<>();
        d.setElement(32.25+12.6);
        Double DouE = d.getElement();
        System.out.println(DouE);

        Box<Character> ch=new Box<>();
        ch.setElement('G');
        Character ChE = ch.getElement();
        System.out.println(ChE);
    }
}

class Box<E> {
    private E element;

    public E getElement() {
        return element;
    }

    public void setElement(E element) {
        this.element = element;
    }
}